package com.koron.order.orderAsset.controller;

import com.koron.bean.base.Response;
import com.koron.order.orderAsset.service.OrderAssetService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api("同步工单数据到工单设备资产库")
@RestController
@RequestMapping("orderAsset")
public class OrderAssetController {

    @Autowired
    private OrderAssetService orderAssetService;

    @ApiOperation("刷新corn表达式")
    @GetMapping("refresh")
    public Response refreshCorn(String corn){
        orderAssetService.refreshCorn(corn);
        return Response.ok();
    }

    @ApiOperation("手动触发一次")
    @GetMapping("trigger")
    public Response trigger(){
        orderAssetService.doTrigger();
        return Response.ok();
    }

}
